package com.ruoyi.performance.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.performance.domain.PerfCheckresult;
import com.ruoyi.performance.service.IPerfCheckresultService;

/**
 * 绩效打分 提供者
 * 
 * @author ygx
 * @date 2020-09-03
 */
@RestController
@RequestMapping("checkresult")
public class PerfCheckresultController extends BaseController
{
	
	@Autowired
	private IPerfCheckresultService perfCheckresultService;
	
	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{perfcheckresultId}")
	public PerfCheckresult get(@PathVariable("perfcheckresultId") Long perfcheckresultId)
	{
		return perfCheckresultService.selectPerfCheckresultById(perfcheckresultId);
		
	}
	
	/**
	 * 查询绩效打分列表
	 */
	@GetMapping("list")
	public R list(PerfCheckresult perfCheckresult)
	{
		startPage();
        return result(perfCheckresultService.selectPerfCheckresultList(perfCheckresult));
	}
	
	
	/**
	 * 新增保存绩效打分
	 */
	@PostMapping("save")
	public R addSave(@RequestBody PerfCheckresult perfCheckresult)
	{		
		return toAjax(perfCheckresultService.insertPerfCheckresult(perfCheckresult));
	}

	/**
	 * 修改保存绩效打分
	 */
	@PostMapping("update")
	public R editSave(@RequestBody Map<String,List<PerfCheckresult>> datas)
	{		
		return toAjax(perfCheckresultService.updatePerfCheckresult(datas));
	}
	
	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{		
		return toAjax(perfCheckresultService.deletePerfCheckresultByIds(ids));
	}
	
}
